package com.itheima.health.controller;

import com.itheima.health.dto.CheckGroupDTO;
import com.itheima.health.entity.QueryPageBean;
import com.itheima.health.entity.Result;
import com.itheima.health.service.CheckGroupService;
import com.itheima.health.service.ReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;

//
@RestController
@Api(tags = "报表管理开发")
public class ReportController {

    // springmvc  消息转化器   @ResponseBody  默认 全字段序列化

    @Reference
    private ReportService reportService;

    @GetMapping("report/findLastyearMemberCountsByMonth/{startDate}/{endDate}")
    public Result findLastyearMemberCountsByMonth(@PathVariable("startDate") String startTime,@PathVariable("endDate") String endTime){
        return new Result(reportService.findLastyearMemberCountsByMonth(startTime,endTime));
    }

    @GetMapping("report/getSexReport")
    public Result getMemberSecReport(){
        return new Result(reportService.getSexReport());
    }


    @GetMapping("report/getAgeReport")
    public Result getMemberAgeReport(){
        return new Result(reportService.getAgeReport());
    }

//    @GetMapping("report/getSetmealProportion")
//    public Result  getSetmealProportion( ){
//        return  new Result(reportService.getSetmealProportion());
//
//    }
    @GetMapping("report/findBusinessData")
    public Result findBusinessData(){
        return  new Result(reportService.findBusinessData());
    }

}
